package com.top.mall.main.income

import android.app.Activity
import android.content.Intent
import com.module.lemlin.owner.OwnerViewModeActivity
import com.top.mall.R
import com.top.mall.jetpack.vm.CouponViewModel
import com.top.mall.main.income.adapter.CouponInviteAdapter
import kotlinx.android.synthetic.main.activity_coupon_invite.*
import kotlinx.android.synthetic.main.activity_coupon_invite.imageViewBack

class CouponInviteActivity : OwnerViewModeActivity<CouponViewModel>() {

    companion object {
        fun open(activity: Activity) {
            val intent = Intent(activity, CouponInviteActivity::class.java)
            activity.startActivity(intent)
        }
    }

    private val couponInviteAdapter: CouponInviteAdapter = CouponInviteAdapter()

    override fun viewModel(): CouponViewModel {
        return createViewModel()
    }

    override val layoutResId: Int
        get() = R.layout.activity_coupon_invite

    override fun stateBar(): StatusBar {
        return StatusBar(view = flCouponInviteBar)
    }

    override fun initView() {

        imageViewBack.setOnClickListener { finish() }
        rvCouponInviteBody.adapter = couponInviteAdapter
    }

    override fun initData() {

        val groups: MutableList<String> = mutableListOf<String>()
        for (index in 0..5) {
            groups.add(index.toString())
        }
        couponInviteAdapter.setNewInstance(groups)
    }
}